/*
 * @Author: Bennty
 * @Date: 2024-07-08 15:24:07
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-08-29 09:39:41
 * @Description: 请填写简介
 */
import request from '@/utils/request';


/** 解析客户地址 */
export const analysisAddressApi = (params: any)=>{
    return request({
        url: 'system/customerInfo/analysisAddress',
        method: 'get',
        params: params
    })
};

/** 查询客户列表 */
export const getCustomerApi = (params:any) => {
    return request({
        url:'/system/customerInfo/list',
        method: 'post',
        data: params
    })
};

/** 根据id获取用户信息 */
export const getCustomerByIdApi = (id:string | number| undefined)=>{
    return request({
        url: `/system/customerInfo/${id}`,
        method: 'get'
    })
};

/** 新增客户 */
export const addCustomerApi = (data:any)=>{
    return request({
        url:'/system/customerInfo',
        method: 'post',
        data: data
    })
};

/** 更新客户 */
export const editCustomerApi = (data:any)=>{
    return request({
        url:'/system/customerInfo',
        method: 'put',
        data: data
    });
};

/** 更新客户标识 */
export const updateSignFlagApi = (params:any)=>{
    return request({
        url: '/system/customerInfo/updateSignFlag',
        method: 'put',
        params: params
    });
};

/** 删除客户 */
export const deleteCustomerByIdApi = (params: any)=>{
    return request({
        url: `/system/customerInfo/deleteById`,
        method: 'delete',
        params: params
    })
};

/** 更改用户结算方式 */
export const updateSettleMethodApi = (params: any)=>{
    return request({
        url:'/system/customerInfo/changeSettleMethod',
        method: 'put',
        params: params
    });
};

/** 手动转公海 */
export const updateBecomePublicApi = (params:any)=>{
    return request({
        url: '/system/customerInfo/becomePublic',
        method: 'put',
        params: params
    });
};

/** 分配客户 */
export const allocationCustomerApi = (data: any)=>{
    return request({
        url: '/system/CustomerJoinPerson',
        method: 'post',
        data: data
    });
};

/** 手动转公海 */
export const toSeaApi = (data: any)=>{
    return request({
        url: '/system/customerInfo/becomePublic',
        method: 'put',
        data: data
    });
}

/** 获取客户公海列表 */
export const getToSeaApi = (params: any)=>{
    return request({
        url: '/system/customerInfo/getPublicList',
        method: 'get',
        params: params
    });
};

/** 导出客户信息 */
export const exportCustomerApi = () => {
    return request({
        url: '/system/customerInfo/export',
        method: 'post'
    });
};

/** 领取客户 */
export const receiveCustomer = (data: any)=>{
    return request({
        url: '/system/CustomerJoinPerson',
        method: 'post',
        data: data
    });
};